<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<AvansRS.Domain.Event>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Events</h2>

    <span>
        <b><%=TempData["Message"]%></b>
        <br /><br />
    </span>
    
    <table>
        <tr>
            <th>
                Name
            </th>
            <th>
                Description
            </th>
            <th>
                Location Name
            </th>
            <th></th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.Encode(item.Name) %>
            </td>
            <td>
                <%= Html.Encode(item.Description) %>
            </td>
            <td>
                <%= Html.Encode(item.Location.Name) %>
            </td>
            <td>
                <%= Html.ActionLink("Edit", "EventEdit", new { id = item.ID })%> |
                <%= Html.ActionLink("Details", "EventDetails", new { id = item.ID })%> |
                <%= Html.ActionLink("Delete", "EventDelete", new { id = item.ID })%>
                <%=Html.ActionLink("Add EventDate", "EventDateCreate", "EventDate", new { ID = item.ID }, null)%>
                <%=Html.ActionLink("Add Registrations", "RegistrationManage", "Event", new { ID = item.ID }, null)%>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%= Html.ActionLink("Create New", "EventCreate") %>
    </p>

</asp:Content>

